/*
 Navicat MySQL Data Transfer

 Source Server         : local
 Source Server Type    : MySQL
 Source Server Version : 90200 (9.2.0)
 Source Host           : localhost:3306
 Source Schema         : ty-crm

 Target Server Type    : MySQL
 Target Server Version : 90200 (9.2.0)
 File Encoding         : 65001

 Date: 03/04/2025 18:18:22
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for admin_menu
-- ----------------------------
DROP TABLE IF EXISTS `admin_menu`;
CREATE TABLE `admin_menu` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
  `parent_id` int unsigned NOT NULL DEFAULT '0' COMMENT '父ID',
  `order` int unsigned NOT NULL DEFAULT '0' COMMENT '排序',
  `title` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '标题',
  `icon` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'icon',
  `uri` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'uri',
  `permission` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'permission',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='菜单';

-- ----------------------------
-- Records of admin_menu
-- ----------------------------
BEGIN;
INSERT INTO `admin_menu` (`id`, `parent_id`, `order`, `title`, `icon`, `uri`, `permission`, `created_at`, `updated_at`) VALUES (1, 0, 1, '首页', 'fa-home', '/', NULL, '2025-01-23 15:05:37', '2025-04-03 14:08:43');
INSERT INTO `admin_menu` (`id`, `parent_id`, `order`, `title`, `icon`, `uri`, `permission`, `created_at`, `updated_at`) VALUES (2, 0, 23, '管理员', 'fa-bars', NULL, NULL, '2025-01-23 15:05:37', '2025-04-03 14:13:21');
INSERT INTO `admin_menu` (`id`, `parent_id`, `order`, `title`, `icon`, `uri`, `permission`, `created_at`, `updated_at`) VALUES (3, 2, 24, '公司管理', NULL, '/company', NULL, '2025-01-23 15:05:37', '2025-04-03 18:16:17');
INSERT INTO `admin_menu` (`id`, `parent_id`, `order`, `title`, `icon`, `uri`, `permission`, `created_at`, `updated_at`) VALUES (4, 2, 25, '角色', NULL, 'auth/roles', NULL, '2025-01-23 15:05:37', '2025-04-03 14:13:21');
INSERT INTO `admin_menu` (`id`, `parent_id`, `order`, `title`, `icon`, `uri`, `permission`, `created_at`, `updated_at`) VALUES (5, 2, 26, '权限', NULL, 'auth/permissions', NULL, '2025-01-23 15:05:37', '2025-04-03 14:13:21');
INSERT INTO `admin_menu` (`id`, `parent_id`, `order`, `title`, `icon`, `uri`, `permission`, `created_at`, `updated_at`) VALUES (6, 2, 27, '菜单', NULL, 'auth/menu', NULL, '2025-01-23 15:05:37', '2025-04-03 14:13:21');
INSERT INTO `admin_menu` (`id`, `parent_id`, `order`, `title`, `icon`, `uri`, `permission`, `created_at`, `updated_at`) VALUES (7, 2, 28, '日志', NULL, 'auth/logs', NULL, '2025-01-23 15:05:37', '2025-04-03 14:13:21');
INSERT INTO `admin_menu` (`id`, `parent_id`, `order`, `title`, `icon`, `uri`, `permission`, `created_at`, `updated_at`) VALUES (8, 0, 2, '重点客户', 'fa-user-md', '/customer', NULL, '2025-04-03 14:03:18', '2025-04-03 14:08:43');
INSERT INTO `admin_menu` (`id`, `parent_id`, `order`, `title`, `icon`, `uri`, `permission`, `created_at`, `updated_at`) VALUES (9, 0, 3, '签约客户', 'fa-american-sign-language-interpreting', '/contractedCustomer', NULL, '2025-04-03 14:03:50', '2025-04-03 14:08:43');
INSERT INTO `admin_menu` (`id`, `parent_id`, `order`, `title`, `icon`, `uri`, `permission`, `created_at`, `updated_at`) VALUES (10, 0, 4, '资源管理', 'fa-database', NULL, NULL, '2025-04-03 14:04:19', '2025-04-03 14:08:43');
INSERT INTO `admin_menu` (`id`, `parent_id`, `order`, `title`, `icon`, `uri`, `permission`, `created_at`, `updated_at`) VALUES (11, 10, 5, '任务管理', NULL, '/task', NULL, '2025-04-03 14:04:43', '2025-04-03 14:26:15');
INSERT INTO `admin_menu` (`id`, `parent_id`, `order`, `title`, `icon`, `uri`, `permission`, `created_at`, `updated_at`) VALUES (12, 10, 6, '我的任务', NULL, '/taskUser', NULL, '2025-04-03 14:05:09', '2025-04-03 14:26:18');
INSERT INTO `admin_menu` (`id`, `parent_id`, `order`, `title`, `icon`, `uri`, `permission`, `created_at`, `updated_at`) VALUES (13, 0, 7, '财务收入', 'fa-leaf', NULL, NULL, '2025-04-03 14:05:34', '2025-04-03 14:08:43');
INSERT INTO `admin_menu` (`id`, `parent_id`, `order`, `title`, `icon`, `uri`, `permission`, `created_at`, `updated_at`) VALUES (14, 13, 8, '新增财务收入', NULL, '/financeIncome/create', NULL, '2025-04-03 14:06:02', '2025-04-03 14:26:21');
INSERT INTO `admin_menu` (`id`, `parent_id`, `order`, `title`, `icon`, `uri`, `permission`, `created_at`, `updated_at`) VALUES (15, 13, 9, '财务收入列表', NULL, '/financeIncome', NULL, '2025-04-03 14:06:19', '2025-04-03 14:26:24');
INSERT INTO `admin_menu` (`id`, `parent_id`, `order`, `title`, `icon`, `uri`, `permission`, `created_at`, `updated_at`) VALUES (16, 0, 10, '财务支出', 'fa-lemon-o', 'fa-lemon-o', NULL, '2025-04-03 14:06:35', '2025-04-03 14:12:52');
INSERT INTO `admin_menu` (`id`, `parent_id`, `order`, `title`, `icon`, `uri`, `permission`, `created_at`, `updated_at`) VALUES (17, 16, 11, '新增财务支出', NULL, '/financeExpenses/create', NULL, '2025-04-03 14:06:56', '2025-04-03 14:26:30');
INSERT INTO `admin_menu` (`id`, `parent_id`, `order`, `title`, `icon`, `uri`, `permission`, `created_at`, `updated_at`) VALUES (18, 16, 12, '财务支出列表', NULL, '/financeExpenses', NULL, '2025-04-03 14:07:13', '2025-04-03 14:26:39');
INSERT INTO `admin_menu` (`id`, `parent_id`, `order`, `title`, `icon`, `uri`, `permission`, `created_at`, `updated_at`) VALUES (19, 0, 13, '员工工资', 'fa-user', '/stuffWages', NULL, '2025-04-03 14:07:41', '2025-04-03 14:08:43');
INSERT INTO `admin_menu` (`id`, `parent_id`, `order`, `title`, `icon`, `uri`, `permission`, `created_at`, `updated_at`) VALUES (20, 0, 14, '财务报表', 'fa-file-audio-o', NULL, NULL, '2025-04-03 14:07:57', '2025-04-03 14:13:06');
INSERT INTO `admin_menu` (`id`, `parent_id`, `order`, `title`, `icon`, `uri`, `permission`, `created_at`, `updated_at`) VALUES (21, 20, 15, '员工报表', NULL, '/reportForms/stuff', NULL, '2025-04-03 14:08:16', '2025-04-03 14:26:48');
INSERT INTO `admin_menu` (`id`, `parent_id`, `order`, `title`, `icon`, `uri`, `permission`, `created_at`, `updated_at`) VALUES (22, 20, 16, '总报表', NULL, '/reportForms/total', NULL, '2025-04-03 14:08:31', '2025-04-03 14:26:51');
INSERT INTO `admin_menu` (`id`, `parent_id`, `order`, `title`, `icon`, `uri`, `permission`, `created_at`, `updated_at`) VALUES (23, 0, 17, '财务审核', 'fa-file-audio-o', NULL, NULL, '2025-04-03 14:08:56', '2025-04-03 14:09:48');
INSERT INTO `admin_menu` (`id`, `parent_id`, `order`, `title`, `icon`, `uri`, `permission`, `created_at`, `updated_at`) VALUES (24, 23, 18, '财务收入审核', NULL, '/audit/incomeAudit', NULL, '2025-04-03 14:10:09', '2025-04-03 14:26:55');
INSERT INTO `admin_menu` (`id`, `parent_id`, `order`, `title`, `icon`, `uri`, `permission`, `created_at`, `updated_at`) VALUES (25, 23, 19, '财务支出审核', NULL, '/audit/expenseAudit', NULL, '2025-04-03 14:10:26', '2025-04-03 14:26:58');
INSERT INTO `admin_menu` (`id`, `parent_id`, `order`, `title`, `icon`, `uri`, `permission`, `created_at`, `updated_at`) VALUES (26, 23, 20, '员工工资审核', NULL, '/audit/wagesAudit', NULL, '2025-04-03 14:10:40', '2025-04-03 14:27:01');
INSERT INTO `admin_menu` (`id`, `parent_id`, `order`, `title`, `icon`, `uri`, `permission`, `created_at`, `updated_at`) VALUES (27, 0, 21, '员工管理', 'fa-users', '/stuff', NULL, '2025-04-03 14:11:07', '2025-04-03 14:12:42');
INSERT INTO `admin_menu` (`id`, `parent_id`, `order`, `title`, `icon`, `uri`, `permission`, `created_at`, `updated_at`) VALUES (28, 0, 22, '黑名单', 'fa-black-tie', '/blacklist', NULL, '2025-04-03 14:11:50', '2025-04-03 14:13:21');
COMMIT;

-- ----------------------------
-- Table structure for admin_operation_log
-- ----------------------------
DROP TABLE IF EXISTS `admin_operation_log`;
CREATE TABLE `admin_operation_log` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
  `user_id` int unsigned NOT NULL COMMENT '用户ID',
  `path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'path',
  `method` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'method',
  `ip` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ip',
  `input` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'input',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='操作日志';

-- ----------------------------
-- Records of admin_operation_log
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for admin_permissions
-- ----------------------------
DROP TABLE IF EXISTS `admin_permissions`;
CREATE TABLE `admin_permissions` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
  `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'name',
  `slug` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'slug',
  `http_method` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'http_method',
  `http_path` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'http_path',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`name`),
  UNIQUE KEY `slug` (`slug`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='权限';

-- ----------------------------
-- Records of admin_permissions
-- ----------------------------
BEGIN;
INSERT INTO `admin_permissions` (`id`, `name`, `slug`, `http_method`, `http_path`, `created_at`, `updated_at`) VALUES (1, '所有', '*', NULL, '*', '2025-01-23 15:08:10', '2025-01-23 15:08:10');
INSERT INTO `admin_permissions` (`id`, `name`, `slug`, `http_method`, `http_path`, `created_at`, `updated_at`) VALUES (2, '首页', 'dashboard', 'GET', '/', '2025-01-23 15:08:10', '2025-01-23 15:08:10');
COMMIT;

-- ----------------------------
-- Table structure for admin_role_menu
-- ----------------------------
DROP TABLE IF EXISTS `admin_role_menu`;
CREATE TABLE `admin_role_menu` (
  `role_id` int unsigned NOT NULL DEFAULT '0' COMMENT '角色ID',
  `menu_id` int unsigned NOT NULL DEFAULT '0' COMMENT '菜单ID',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  PRIMARY KEY (`role_id`,`menu_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='角色菜单';

-- ----------------------------
-- Records of admin_role_menu
-- ----------------------------
BEGIN;
INSERT INTO `admin_role_menu` (`role_id`, `menu_id`, `created_at`, `updated_at`) VALUES (1, 8, '2025-04-03 14:03:18', '2025-04-03 14:03:18');
INSERT INTO `admin_role_menu` (`role_id`, `menu_id`, `created_at`, `updated_at`) VALUES (1, 9, '2025-04-03 14:03:50', '2025-04-03 14:03:50');
INSERT INTO `admin_role_menu` (`role_id`, `menu_id`, `created_at`, `updated_at`) VALUES (1, 11, '2025-04-03 14:04:43', '2025-04-03 14:04:43');
INSERT INTO `admin_role_menu` (`role_id`, `menu_id`, `created_at`, `updated_at`) VALUES (1, 12, '2025-04-03 14:05:09', '2025-04-03 14:05:09');
INSERT INTO `admin_role_menu` (`role_id`, `menu_id`, `created_at`, `updated_at`) VALUES (1, 13, '2025-04-03 14:05:34', '2025-04-03 14:05:34');
INSERT INTO `admin_role_menu` (`role_id`, `menu_id`, `created_at`, `updated_at`) VALUES (1, 16, '2025-04-03 14:06:35', '2025-04-03 14:06:35');
INSERT INTO `admin_role_menu` (`role_id`, `menu_id`, `created_at`, `updated_at`) VALUES (1, 19, '2025-04-03 14:07:41', '2025-04-03 14:07:41');
INSERT INTO `admin_role_menu` (`role_id`, `menu_id`, `created_at`, `updated_at`) VALUES (1, 20, '2025-04-03 14:07:57', '2025-04-03 14:07:57');
INSERT INTO `admin_role_menu` (`role_id`, `menu_id`, `created_at`, `updated_at`) VALUES (1, 23, '2025-04-03 14:08:56', '2025-04-03 14:08:56');
INSERT INTO `admin_role_menu` (`role_id`, `menu_id`, `created_at`, `updated_at`) VALUES (1, 27, '2025-04-03 14:11:07', '2025-04-03 14:11:07');
INSERT INTO `admin_role_menu` (`role_id`, `menu_id`, `created_at`, `updated_at`) VALUES (1, 28, '2025-04-03 14:11:50', '2025-04-03 14:11:50');
INSERT INTO `admin_role_menu` (`role_id`, `menu_id`, `created_at`, `updated_at`) VALUES (2, 8, '2025-04-03 14:03:18', '2025-04-03 14:03:18');
INSERT INTO `admin_role_menu` (`role_id`, `menu_id`, `created_at`, `updated_at`) VALUES (2, 9, '2025-04-03 14:03:50', '2025-04-03 14:03:50');
INSERT INTO `admin_role_menu` (`role_id`, `menu_id`, `created_at`, `updated_at`) VALUES (2, 11, '2025-04-03 14:04:43', '2025-04-03 14:04:43');
INSERT INTO `admin_role_menu` (`role_id`, `menu_id`, `created_at`, `updated_at`) VALUES (2, 12, '2025-04-03 14:05:09', '2025-04-03 14:05:09');
INSERT INTO `admin_role_menu` (`role_id`, `menu_id`, `created_at`, `updated_at`) VALUES (2, 13, '2025-04-03 14:05:34', '2025-04-03 14:05:34');
INSERT INTO `admin_role_menu` (`role_id`, `menu_id`, `created_at`, `updated_at`) VALUES (2, 16, '2025-04-03 14:06:35', '2025-04-03 14:06:35');
INSERT INTO `admin_role_menu` (`role_id`, `menu_id`, `created_at`, `updated_at`) VALUES (2, 19, '2025-04-03 14:07:41', '2025-04-03 14:07:41');
INSERT INTO `admin_role_menu` (`role_id`, `menu_id`, `created_at`, `updated_at`) VALUES (2, 20, '2025-04-03 14:07:57', '2025-04-03 14:07:57');
INSERT INTO `admin_role_menu` (`role_id`, `menu_id`, `created_at`, `updated_at`) VALUES (2, 23, '2025-04-03 14:08:56', '2025-04-03 14:08:56');
INSERT INTO `admin_role_menu` (`role_id`, `menu_id`, `created_at`, `updated_at`) VALUES (2, 27, '2025-04-03 14:11:07', '2025-04-03 14:11:07');
INSERT INTO `admin_role_menu` (`role_id`, `menu_id`, `created_at`, `updated_at`) VALUES (2, 28, '2025-04-03 14:11:50', '2025-04-03 14:11:50');
INSERT INTO `admin_role_menu` (`role_id`, `menu_id`, `created_at`, `updated_at`) VALUES (3, 8, '2025-04-03 14:03:18', '2025-04-03 14:03:18');
INSERT INTO `admin_role_menu` (`role_id`, `menu_id`, `created_at`, `updated_at`) VALUES (3, 12, '2025-04-03 14:05:09', '2025-04-03 14:05:09');
INSERT INTO `admin_role_menu` (`role_id`, `menu_id`, `created_at`, `updated_at`) VALUES (3, 28, '2025-04-03 14:11:50', '2025-04-03 14:11:50');
INSERT INTO `admin_role_menu` (`role_id`, `menu_id`, `created_at`, `updated_at`) VALUES (4, 8, '2025-04-03 14:03:18', '2025-04-03 14:03:18');
INSERT INTO `admin_role_menu` (`role_id`, `menu_id`, `created_at`, `updated_at`) VALUES (4, 9, '2025-04-03 14:03:50', '2025-04-03 14:03:50');
INSERT INTO `admin_role_menu` (`role_id`, `menu_id`, `created_at`, `updated_at`) VALUES (4, 11, '2025-04-03 14:04:43', '2025-04-03 14:04:43');
INSERT INTO `admin_role_menu` (`role_id`, `menu_id`, `created_at`, `updated_at`) VALUES (4, 12, '2025-04-03 14:05:09', '2025-04-03 14:05:09');
INSERT INTO `admin_role_menu` (`role_id`, `menu_id`, `created_at`, `updated_at`) VALUES (4, 13, '2025-04-03 14:05:34', '2025-04-03 14:05:34');
INSERT INTO `admin_role_menu` (`role_id`, `menu_id`, `created_at`, `updated_at`) VALUES (4, 16, '2025-04-03 14:06:35', '2025-04-03 14:06:35');
INSERT INTO `admin_role_menu` (`role_id`, `menu_id`, `created_at`, `updated_at`) VALUES (4, 19, '2025-04-03 14:07:41', '2025-04-03 14:07:41');
INSERT INTO `admin_role_menu` (`role_id`, `menu_id`, `created_at`, `updated_at`) VALUES (4, 20, '2025-04-03 14:07:57', '2025-04-03 14:07:57');
INSERT INTO `admin_role_menu` (`role_id`, `menu_id`, `created_at`, `updated_at`) VALUES (4, 27, '2025-04-03 14:11:07', '2025-04-03 14:11:07');
INSERT INTO `admin_role_menu` (`role_id`, `menu_id`, `created_at`, `updated_at`) VALUES (4, 28, '2025-04-03 14:11:50', '2025-04-03 14:11:50');
COMMIT;

-- ----------------------------
-- Table structure for admin_role_permissions
-- ----------------------------
DROP TABLE IF EXISTS `admin_role_permissions`;
CREATE TABLE `admin_role_permissions` (
  `role_id` int unsigned NOT NULL DEFAULT '0' COMMENT '角色ID',
  `permission_id` int unsigned NOT NULL DEFAULT '0' COMMENT '权限ID',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  PRIMARY KEY (`role_id`,`permission_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='角色权限表';

-- ----------------------------
-- Records of admin_role_permissions
-- ----------------------------
BEGIN;
INSERT INTO `admin_role_permissions` (`role_id`, `permission_id`, `created_at`, `updated_at`) VALUES (1, 1, '2025-01-23 15:12:17', '2025-01-23 15:12:17');
INSERT INTO `admin_role_permissions` (`role_id`, `permission_id`, `created_at`, `updated_at`) VALUES (2, 1, '2025-04-03 14:02:24', '2025-04-03 14:02:24');
INSERT INTO `admin_role_permissions` (`role_id`, `permission_id`, `created_at`, `updated_at`) VALUES (3, 1, '2025-04-03 14:02:41', '2025-04-03 14:02:41');
INSERT INTO `admin_role_permissions` (`role_id`, `permission_id`, `created_at`, `updated_at`) VALUES (4, 1, '2025-04-03 14:02:54', '2025-04-03 14:02:54');
COMMIT;

-- ----------------------------
-- Table structure for admin_role_users
-- ----------------------------
DROP TABLE IF EXISTS `admin_role_users`;
CREATE TABLE `admin_role_users` (
  `role_id` int unsigned NOT NULL DEFAULT '0' COMMENT '角色ID',
  `user_id` int unsigned NOT NULL DEFAULT '0' COMMENT '用户ID',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  PRIMARY KEY (`role_id`,`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='角色用户表';

-- ----------------------------
-- Records of admin_role_users
-- ----------------------------
BEGIN;
INSERT INTO `admin_role_users` (`role_id`, `user_id`, `created_at`, `updated_at`) VALUES (1, 1, '2025-01-23 15:16:58', '2025-01-23 15:16:58');
INSERT INTO `admin_role_users` (`role_id`, `user_id`, `created_at`, `updated_at`) VALUES (2, 2, '2025-04-03 16:37:39', '2025-04-03 16:37:39');
INSERT INTO `admin_role_users` (`role_id`, `user_id`, `created_at`, `updated_at`) VALUES (3, 3, '2025-04-03 16:38:21', '2025-04-03 16:38:21');
INSERT INTO `admin_role_users` (`role_id`, `user_id`, `created_at`, `updated_at`) VALUES (4, 4, '2025-04-03 17:21:07', '2025-04-03 17:21:07');
COMMIT;

-- ----------------------------
-- Table structure for admin_roles
-- ----------------------------
DROP TABLE IF EXISTS `admin_roles`;
CREATE TABLE `admin_roles` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
  `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '名称',
  `slug` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'slug',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`name`),
  UNIQUE KEY `slug` (`slug`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='角色';

-- ----------------------------
-- Records of admin_roles
-- ----------------------------
BEGIN;
INSERT INTO `admin_roles` (`id`, `name`, `slug`, `created_at`, `updated_at`) VALUES (1, 'Administrator', 'Administrator', '2025-01-23 15:17:23', '2025-01-23 15:17:23');
INSERT INTO `admin_roles` (`id`, `name`, `slug`, `created_at`, `updated_at`) VALUES (2, '老板', 'boss', '2025-04-03 14:02:24', '2025-04-03 14:02:24');
INSERT INTO `admin_roles` (`id`, `name`, `slug`, `created_at`, `updated_at`) VALUES (3, '员工', 'stuff', '2025-04-03 14:02:41', '2025-04-03 14:02:41');
INSERT INTO `admin_roles` (`id`, `name`, `slug`, `created_at`, `updated_at`) VALUES (4, '财务', 'finance', '2025-04-03 14:02:54', '2025-04-03 14:43:27');
COMMIT;

-- ----------------------------
-- Table structure for admin_user_permissions
-- ----------------------------
DROP TABLE IF EXISTS `admin_user_permissions`;
CREATE TABLE `admin_user_permissions` (
  `user_id` int unsigned NOT NULL DEFAULT '0' COMMENT '角色ID',
  `permission_id` int unsigned NOT NULL DEFAULT '0' COMMENT '权限ID',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  PRIMARY KEY (`user_id`,`permission_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='用户权限表';

-- ----------------------------
-- Records of admin_user_permissions
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for admin_users
-- ----------------------------
DROP TABLE IF EXISTS `admin_users`;
CREATE TABLE `admin_users` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
  `username` varchar(190) COLLATE utf8mb4_general_ci NOT NULL COMMENT '用户名',
  `password` varchar(60) COLLATE utf8mb4_general_ci NOT NULL COMMENT '密码',
  `name` varchar(255) COLLATE utf8mb4_general_ci NOT NULL COMMENT '姓名',
  `avatar` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '头像',
  `remember_token` varchar(100) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '记住我',
  `last_login_at` timestamp NULL DEFAULT NULL COMMENT '上次登录时间',
  `status` tinyint unsigned NOT NULL DEFAULT '1' COMMENT '0:禁用;1:正常;',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `username` (`username`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='管理员';

-- ----------------------------
-- Records of admin_users
-- ----------------------------
BEGIN;
INSERT INTO `admin_users` (`id`, `username`, `password`, `name`, `avatar`, `remember_token`, `last_login_at`, `status`, `created_at`, `updated_at`) VALUES (1, 'admin', '$2y$12$kpBmIFCxs5/1ICA/3uiZXOSbCMbaXIbPyVDL8N2KhC2yw3fnfG3Yy', 'Administrator', NULL, NULL, NULL, 1, '2025-04-03 18:16:37', '2025-04-03 18:16:37');
COMMIT;

-- ----------------------------
-- Table structure for admin_users_related
-- ----------------------------
DROP TABLE IF EXISTS `admin_users_related`;
CREATE TABLE `admin_users_related` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
  `main_id` int unsigned NOT NULL DEFAULT '0' COMMENT '主账号id',
  `user_id` int unsigned NOT NULL DEFAULT '0' COMMENT '角色ID',
  `qq` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'qq',
  `mobile` char(11) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '手机号',
  `id_number` char(18) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '身份证号',
  `service_date` date DEFAULT NULL COMMENT '入职日期',
  `role` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '0:员工;1:财务;',
  `home_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '家庭地址',
  `living_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '居住地址',
  `remark` text COLLATE utf8mb4_general_ci COMMENT '备注',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='管理员附属表';

-- ----------------------------
-- Records of admin_users_related
-- ----------------------------
BEGIN;
INSERT INTO `admin_users_related` (`id`, `main_id`, `user_id`, `qq`, `mobile`, `id_number`, `service_date`, `role`, `home_address`, `living_address`, `remark`, `created_at`, `updated_at`) VALUES (1, 0, 1, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, '2025-04-03 18:16:42', '2025-04-03 18:16:42');
COMMIT;

-- ----------------------------
-- Table structure for blacklist
-- ----------------------------
DROP TABLE IF EXISTS `blacklist`;
CREATE TABLE `blacklist` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
  `name` varchar(255) COLLATE utf8mb4_general_ci NOT NULL COMMENT '客户名称',
  `age` tinyint unsigned NOT NULL COMMENT '年龄',
  `gender` tinyint unsigned NOT NULL DEFAULT '1' COMMENT '性别;0:女;1:男;',
  `area` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '地区',
  `mobile` char(11) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '手机号',
  `wechat` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '微信',
  `status` tinyint unsigned DEFAULT NULL COMMENT '状态;0:无法接通;1:接通挂断;2:有意向;3:无效;4:黑名单;',
  `extends` json DEFAULT NULL COMMENT '拓展',
  `remark` text COLLATE utf8mb4_general_ci COMMENT '备注',
  `follow_user_id` int unsigned DEFAULT NULL COMMENT '回访人id',
  `main_id` int unsigned DEFAULT NULL COMMENT '主账号id',
  `operator_id` int unsigned DEFAULT NULL COMMENT '操作人id',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='黑名单';

-- ----------------------------
-- Records of blacklist
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for cache
-- ----------------------------
DROP TABLE IF EXISTS `cache`;
CREATE TABLE `cache` (
  `key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `value` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `expiration` int unsigned NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  PRIMARY KEY (`key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of cache
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for cache_locks
-- ----------------------------
DROP TABLE IF EXISTS `cache_locks`;
CREATE TABLE `cache_locks` (
  `key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `owner` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `expiration` int NOT NULL,
  PRIMARY KEY (`key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of cache_locks
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for contracted_customer
-- ----------------------------
DROP TABLE IF EXISTS `contracted_customer`;
CREATE TABLE `contracted_customer` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
  `contract_no` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '合同编号',
  `male_name` varchar(255) COLLATE utf8mb4_general_ci NOT NULL COMMENT '男方姓名',
  `male_blood_type` tinyint unsigned DEFAULT NULL COMMENT '男方血型;0:A型;1:B型;2:AB型;3:O型;',
  `male_mobile` char(11) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '男方手机号',
  `female_name` varchar(255) COLLATE utf8mb4_general_ci NOT NULL COMMENT '女方姓名',
  `female_blood_type` tinyint unsigned DEFAULT NULL COMMENT '女方血型;0:A型;1:B型;2:AB型;3:O型;',
  `female_mobile` char(11) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '女方手机号',
  `contact_address` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '通讯地址',
  `remark` text COLLATE utf8mb4_general_ci COMMENT '备注',
  `contract_amount` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '合同金额',
  `freeze_date` date DEFAULT NULL COMMENT '冷冻日期',
  `operate_id` int unsigned DEFAULT NULL COMMENT '业务员id',
  `main_id` int unsigned DEFAULT NULL COMMENT '主账号id',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='签约客户表';

-- ----------------------------
-- Records of contracted_customer
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for customer
-- ----------------------------
DROP TABLE IF EXISTS `customer`;
CREATE TABLE `customer` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
  `serial_number` char(20) COLLATE utf8mb4_general_ci NOT NULL COMMENT '序列号',
  `customer_name` varchar(255) COLLATE utf8mb4_general_ci NOT NULL COMMENT '客户名称',
  `age` tinyint unsigned DEFAULT '0' COMMENT '年龄',
  `customer_gender` tinyint unsigned NOT NULL DEFAULT '2' COMMENT '性别;0:女;1:男;2:暂无;',
  `customer_mobile` char(11) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '手机号',
  `customer_wechat` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '微信',
  `customer_qq` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'qq',
  `score` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '分数',
  `education` tinyint unsigned DEFAULT NULL COMMENT '学历;0:初中及以下;1:高中;2:大专;3:本科;4:硕士;5:博士;',
  `information_resources` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '信息来源;0:新媒体平台;1:号码抓取;2:朋友介绍;3:外部接口数据分配;4:其他;',
  `customer_status` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '状态;0:信息录入;1:已签约;2:失败;',
  `customer_address` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '地址',
  `remark` text COLLATE utf8mb4_general_ci COMMENT '备注',
  `extends` json DEFAULT NULL COMMENT '拓展',
  `is_forward` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '是否转赠;0:否;1:是;',
  `forward_extends` json DEFAULT NULL COMMENT '转赠记录',
  `main_id` int unsigned DEFAULT NULL COMMENT '主账号id',
  `operator_id` int unsigned DEFAULT NULL COMMENT '操作人id',
  `follow_up_at` timestamp NULL DEFAULT NULL COMMENT '回访时间',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='客户表';

-- ----------------------------
-- Records of customer
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for customer_follow_record
-- ----------------------------
DROP TABLE IF EXISTS `customer_follow_record`;
CREATE TABLE `customer_follow_record` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
  `customer_id` int unsigned DEFAULT NULL COMMENT '重点客户',
  `date` date DEFAULT NULL COMMENT '日期',
  `times` int unsigned NOT NULL DEFAULT '0' COMMENT '次数',
  `operator_id` int unsigned DEFAULT NULL COMMENT '操作人id',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='重点客户访问统计表';

-- ----------------------------
-- Records of customer_follow_record
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for failed_jobs
-- ----------------------------
DROP TABLE IF EXISTS `failed_jobs`;
CREATE TABLE `failed_jobs` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
  `uuid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `connection` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `queue` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `payload` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `exception` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `failed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `uuid` (`uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='failed_jobs';

-- ----------------------------
-- Records of failed_jobs
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for finance_expenses
-- ----------------------------
DROP TABLE IF EXISTS `finance_expenses`;
CREATE TABLE `finance_expenses` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
  `name` varchar(255) COLLATE utf8mb4_general_ci NOT NULL COMMENT '名称',
  `contracted_customer_id` int unsigned DEFAULT NULL COMMENT '签约客户id',
  `num` int unsigned NOT NULL DEFAULT '0' COMMENT '数量',
  `amount` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '金额',
  `date` date DEFAULT NULL COMMENT '日期',
  `type` tinyint DEFAULT NULL COMMENT '类别;0:餐食;1:医疗;2:通讯;3:其他;',
  `invoice_type` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '发票类型;0:发票;1:收据;2:订单图;3:全无;',
  `invoice_proof` json DEFAULT NULL COMMENT '拓展',
  `status` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '审核状态;0:未审核;1:审核通过;2:拒绝;',
  `remark` text COLLATE utf8mb4_general_ci COMMENT '备注',
  `audit_remark` text COLLATE utf8mb4_general_ci COMMENT '审核备注',
  `audit_id` int unsigned DEFAULT NULL COMMENT '审核人',
  `audit_at` timestamp NULL DEFAULT NULL COMMENT '审核时间',
  `main_id` int unsigned DEFAULT NULL COMMENT '主账号id',
  `operate_id` int unsigned DEFAULT NULL COMMENT '业务员id',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='财务支出';

-- ----------------------------
-- Records of finance_expenses
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for finance_income
-- ----------------------------
DROP TABLE IF EXISTS `finance_income`;
CREATE TABLE `finance_income` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
  `income_type` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '收款事由',
  `contracted_customer_id` int unsigned DEFAULT NULL COMMENT '签约客户id',
  `income_received` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '已收款金额',
  `income_amount` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '打款金额',
  `actual_income_amount` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '到账金额',
  `income_date` date DEFAULT NULL COMMENT '收款日期',
  `remark` text COLLATE utf8mb4_general_ci COMMENT '备注',
  `status` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '审核状态;0:未审核;1:审核通过;2:拒绝;',
  `audit_remark` text COLLATE utf8mb4_general_ci COMMENT '审核备注',
  `audit_id` int unsigned DEFAULT NULL COMMENT '审核人',
  `operate_id` int unsigned DEFAULT NULL COMMENT '业务员id',
  `main_id` int unsigned DEFAULT NULL COMMENT '主账号id',
  `audit_at` timestamp NULL DEFAULT NULL COMMENT '审核时间',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='财务收入';

-- ----------------------------
-- Records of finance_income
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for job_batches
-- ----------------------------
DROP TABLE IF EXISTS `job_batches`;
CREATE TABLE `job_batches` (
  `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `total_jobs` int NOT NULL,
  `pending_jobs` int NOT NULL,
  `failed_jobs` int NOT NULL,
  `failed_job_ids` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `options` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `cancelled_at` int DEFAULT NULL,
  `created_at` int NOT NULL,
  `finished_at` int DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of job_batches
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for jobs
-- ----------------------------
DROP TABLE IF EXISTS `jobs`;
CREATE TABLE `jobs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `queue` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `payload` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `attempts` tinyint unsigned NOT NULL,
  `reserved_at` int unsigned DEFAULT NULL,
  `available_at` int unsigned NOT NULL,
  `created_at` int unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `jobs_queue_index` (`queue`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of jobs
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for migrations
-- ----------------------------
DROP TABLE IF EXISTS `migrations`;
CREATE TABLE `migrations` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `migration` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `batch` int NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of migrations
-- ----------------------------
BEGIN;
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (1, '0001_01_01_000000_create_users_table', 1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (2, '0001_01_01_000001_create_cache_table', 1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (3, '0001_01_01_000002_create_jobs_table', 1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (4, '2016_01_04_173148_create_admin_tables', 1);
COMMIT;

-- ----------------------------
-- Table structure for password_reset_tokens
-- ----------------------------
DROP TABLE IF EXISTS `password_reset_tokens`;
CREATE TABLE `password_reset_tokens` (
  `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `token` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='password_reset_tokens';

-- ----------------------------
-- Records of password_reset_tokens
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for sessions
-- ----------------------------
DROP TABLE IF EXISTS `sessions`;
CREATE TABLE `sessions` (
  `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `ip_address` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `user_agent` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `payload` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `last_activity` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `sessions_user_id_index` (`user_id`),
  KEY `sessions_last_activity_index` (`last_activity`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of sessions
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for stuff_wages
-- ----------------------------
DROP TABLE IF EXISTS `stuff_wages`;
CREATE TABLE `stuff_wages` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
  `date` date DEFAULT NULL COMMENT '日期',
  `user_id` int unsigned DEFAULT NULL COMMENT '员工id',
  `basic_wages` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '基本薪资',
  `commission` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '提成',
  `deduct` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '应扣费用',
  `actual_wages` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '实发工资',
  `status` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '审核状态;0:未审核;1:审核通过;2:拒绝;',
  `remark` text COLLATE utf8mb4_general_ci COMMENT '备注',
  `audit_remark` text COLLATE utf8mb4_general_ci COMMENT '审核备注',
  `audit_id` int unsigned DEFAULT NULL COMMENT '审核人',
  `audit_at` timestamp NULL DEFAULT NULL COMMENT '审核时间',
  `operate_id` int unsigned DEFAULT NULL COMMENT '添加人id',
  `main_id` int unsigned DEFAULT NULL COMMENT '主账号id',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='员工工资';

-- ----------------------------
-- Records of stuff_wages
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for task
-- ----------------------------
DROP TABLE IF EXISTS `task`;
CREATE TABLE `task` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
  `serial_number` char(20) COLLATE utf8mb4_general_ci NOT NULL COMMENT '序列号',
  `task_name` varchar(255) COLLATE utf8mb4_general_ci NOT NULL COMMENT '任务名(资源名称)',
  `remark` text COLLATE utf8mb4_general_ci COMMENT '备注',
  `total_task_num` int unsigned NOT NULL DEFAULT '0' COMMENT '总任务数',
  `main_id` int unsigned DEFAULT NULL COMMENT '主账号id',
  `from_id` int unsigned NOT NULL DEFAULT '0' COMMENT '上一级id',
  `creator_id` int unsigned DEFAULT NULL COMMENT '创建人id',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='资源管理表';

-- ----------------------------
-- Records of task
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for task_related
-- ----------------------------
DROP TABLE IF EXISTS `task_related`;
CREATE TABLE `task_related` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
  `task_id` int unsigned DEFAULT NULL COMMENT '任务id',
  `name` varchar(255) COLLATE utf8mb4_general_ci NOT NULL COMMENT '客户名称',
  `gender` tinyint unsigned NOT NULL DEFAULT '2' COMMENT '性别;0:女;1:男;2:暂无;',
  `age` tinyint unsigned DEFAULT '0' COMMENT '年龄',
  `area` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '地区',
  `mobile` char(11) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '手机号',
  `wechat` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '微信',
  `remark` text COLLATE utf8mb4_general_ci COMMENT '备注',
  `operator_id` int unsigned DEFAULT NULL COMMENT '操作人id',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='任务关联表';

-- ----------------------------
-- Records of task_related
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for task_user
-- ----------------------------
DROP TABLE IF EXISTS `task_user`;
CREATE TABLE `task_user` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
  `task_id` int unsigned DEFAULT NULL COMMENT '任务id',
  `from_id` int unsigned NOT NULL DEFAULT '0' COMMENT '上一级id',
  `follow_user_id` int unsigned DEFAULT NULL COMMENT '回访人id',
  `intentional_num` int unsigned NOT NULL DEFAULT '0' COMMENT '有意向',
  `invalid_num` int unsigned NOT NULL DEFAULT '0' COMMENT '无效',
  `none_reply_num` int unsigned NOT NULL DEFAULT '0' COMMENT '无人接听',
  `hang_up_num` int unsigned NOT NULL DEFAULT '0' COMMENT '接通后挂断',
  `blacklist_num` int unsigned NOT NULL DEFAULT '0' COMMENT '黑名单',
  `completion_progress_num` int unsigned NOT NULL DEFAULT '0' COMMENT '完成进度',
  `total_task_num` int unsigned NOT NULL DEFAULT '0' COMMENT '总任务数',
  `main_id` int unsigned DEFAULT NULL COMMENT '主账号id',
  `operator_id` int unsigned DEFAULT NULL COMMENT '操作人id',
  `extends` json DEFAULT NULL COMMENT '拓展',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='员工任务表';

-- ----------------------------
-- Records of task_user
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for task_user_related
-- ----------------------------
DROP TABLE IF EXISTS `task_user_related`;
CREATE TABLE `task_user_related` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
  `task_user_id` int unsigned DEFAULT NULL COMMENT '任务id',
  `task_related_id` int unsigned DEFAULT NULL COMMENT '任务关联id',
  `status` tinyint unsigned DEFAULT NULL COMMENT '状态;0:无人接听;1:接通挂断;2:有意向;3:无效;4:黑名单;',
  `extends` json DEFAULT NULL COMMENT '拓展',
  `follow_up_at` timestamp NULL DEFAULT NULL COMMENT '回访时间',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='员工任务关联表';

-- ----------------------------
-- Records of task_user_related
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for task_user_related_record
-- ----------------------------
DROP TABLE IF EXISTS `task_user_related_record`;
CREATE TABLE `task_user_related_record` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
  `task_related_id` int unsigned DEFAULT NULL COMMENT '回访客户id',
  `date` date DEFAULT NULL COMMENT '日期',
  `times` int unsigned NOT NULL DEFAULT '0' COMMENT '次数',
  `operator_id` int unsigned DEFAULT NULL COMMENT '操作人id',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='任务客户回访数';

-- ----------------------------
-- Records of task_user_related_record
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `demo_detail_id` int unsigned NOT NULL,
  `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `a` vector(2048) DEFAULT NULL,
  PRIMARY KEY (`id`,`demo_detail_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of user
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for users
-- ----------------------------
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `email_verified_at` timestamp NULL DEFAULT NULL,
  `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `remember_token` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `email` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='users';

-- ----------------------------
-- Records of users
-- ----------------------------
BEGIN;
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
